<template>
  <div>
    <div class="common-form">活动时间</div>
    <el-form-item
      label="报名截止日期"
      prop="joinEndTime"
      :rules="[
        { required: true, message: '请选择报名截止日期', trigger: 'change' },
      ]"
    >
      <el-col :span="11">
        <el-date-picker
          v-model="form.joinEndTime"
          type="datetime"
          placeholder="报名截止日期"
          format="YYYY-MM-DD HH:mm"
          value-format="YYYY-MM-DD HH:mm"
        ></el-date-picker>
      </el-col>
    </el-form-item>
    <el-form-item
      label="活动日期"
      prop="activeDate"
      :rules="[
        { required: true, message: '请选择活动日期', trigger: 'change' },
      ]"
    >
      <el-col :span="11">
        <el-date-picker
          v-model="form.activeDate"
          type="daterange"
          align="right"
          unlink-panels
          range-separator="至"
          start-placeholder="活动开始日期"
          end-placeholder="活动结束日期"
          format="YYYY-MM-DD"
          value-format="YYYY-MM-DD"
          :picker-options="pickerOptions"
        ></el-date-picker>
      </el-col>
    </el-form-item>

    <el-form-item
      label="凑团时间"
      :rules="[{ required: true, message: ' ' }]"
      prop="togetherTime"
    >
      <div class="max-w460 d-s-c">
        <div class="flex-1">
          <el-input v-model="form.togetherTime" type="number"></el-input>
        </div>
        <span class="pl16">小时</span>
      </div>
    </el-form-item>
  </div>
</template>

<script>
export default {
  data() {
    return {
      /*如果没有后面的-8.64e7就是不可以选择今天的*/
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7;
        },
      },
    };
  },
  inject: ["form"],
};
</script>

<style></style>
